# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1CheckGroundingResponseClaim do
  @moduledoc """
  Text and citation info for a claim in the answer candidate.

  ## Attributes

  *   `citationIndices` (*type:* `list(integer())`, *default:* `nil`) - A list of indices (into 'cited_chunks') specifying the citations associated with the claim. For instance [1,3,4] means that cited_chunks[1], cited_chunks[3], cited_chunks[4] are the facts cited supporting for the claim. A citation to a fact indicates that the claim is supported by the fact.
  *   `claimText` (*type:* `String.t`, *default:* `nil`) - Text for the claim in the answer candidate. Always provided regardless of whether citations or anti-citations are found.
  *   `endPos` (*type:* `integer()`, *default:* `nil`) - Position indicating the end of the claim in the answer candidate, exclusive, in bytes. Note that this is not measured in characters and, therefore, must be rendered as such. For example, if the claim text contains non-ASCII characters, the start and end positions vary when measured in characters (programming-language-dependent) and when measured in bytes (programming-language-independent).
  *   `groundingCheckRequired` (*type:* `boolean()`, *default:* `nil`) - Indicates that this claim required grounding check. When the system decided this claim doesn't require attribution/grounding check, this field will be set to false. In that case, no grounding check was done for the claim and therefore citation_indices should not be returned.
  *   `startPos` (*type:* `integer()`, *default:* `nil`) - Position indicating the start of the claim in the answer candidate, measured in bytes. Note that this is not measured in characters and, therefore, must be rendered in the user interface keeping in mind that some characters may take more than one byte. For example, if the claim text contains non-ASCII characters, the start and end positions vary when measured in characters (programming-language-dependent) and when measured in bytes (programming-language-independent).
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :citationIndices => list(integer()) | nil,
          :claimText => String.t() | nil,
          :endPos => integer() | nil,
          :groundingCheckRequired => boolean() | nil,
          :startPos => integer() | nil
        }

  field(:citationIndices, type: :list)
  field(:claimText)
  field(:endPos)
  field(:groundingCheckRequired)
  field(:startPos)
end

defimpl Poison.Decoder,
  for: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1CheckGroundingResponseClaim do
  def decode(value, options) do
    GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1CheckGroundingResponseClaim.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DiscoveryEngine.V1.Model.GoogleCloudDiscoveryengineV1CheckGroundingResponseClaim do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
